import request from '@/utils/request'

export default {
  // 文章列表条件分页查询
  getList(current, size, data) {
    return request({
      url: `/article/article/search/${current}/${size}`,
      method: 'post',
      data
    })
  },
  // 文章设置为推荐
  recommendYes(articleId) {
    return request({
      url: `/article/article/recommend/${articleId}`,
      method: 'get'
    })
  },
  // 取消推荐文章
  recommendNo(articleId) {
    return request({
      url: `/article/article/recommend/cancel/${articleId}`,
      method: 'get'
    })
  },
  // 根据文章ID查询文章详情
  getById(articleId) {
    return request({
      url: `/article/article/${articleId}`,
      method: 'get'
    })
  },
  // 文章审核通过
  auditPass(articleId) {
    return request({
      url: `/article/article/audit/success/${articleId}`,
      method: 'get'
    })
  },
  // 文章审核未通过
  auditNoPass(articleId, fail) {
    return request({
      url: `/article/article/audit/fail/${articleId}/${fail}`,
      method: 'get'
    })
  },
  // 根据ID删除文章（逻辑删除
  deleteById(articleId) {
    return request({
      url: `/article/article/admin/${articleId}`,
      method: 'delete'
    })
  }
}
